package com.example.coursedesign.ui.home.entity;

import android.os.Parcel;
import android.os.Parcelable;

public class mRemind implements Parcelable {
    private Integer id;
    private String name;
    private String picture;
    private String number;
    private String time;
    private String currentNumber;
    private String remindTime;
    private String detail;
    private String status = "未服用";
    private String account;

    public mRemind() {}

    public mRemind(Integer id, String name, String picture, String number, String time, String currentNumber, String remindTime, String detail, String status,String account) {
        this.id = id;
        this.name = name;
        this.picture = picture;
        this.number = number;
        this.time = time;
        this.currentNumber = currentNumber;
        this.remindTime = remindTime;
        this.detail = detail;
        this.status = status == null ? "未服用" : status; // 确保状态不会为空
        this.account = account;
    }

    protected mRemind(Parcel in) {
        if (in.readByte() == 0) {
            id = null;
        } else {
            id = in.readInt();
        }
        account = in.readString();
        name = in.readString();
        picture = in.readString();
        number = in.readString();
        time = in.readString();
        currentNumber = in.readString();
        remindTime = in.readString();
        detail = in.readString();
        if (in.readByte() == 0) {
            status = null;
        } else {
            status = in.readString();
        }
    }

    public static final Creator<mRemind> CREATOR = new Creator<mRemind>() {
        @Override
        public mRemind createFromParcel(Parcel in) {
            return new mRemind(in);
        }

        @Override
        public mRemind[] newArray(int size) {
            return new mRemind[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        if (id == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(id);
        }
        dest.writeString(account);
        dest.writeString(name);
        dest.writeString(picture);
        dest.writeString(number);
        dest.writeString(time);
        dest.writeString(currentNumber);
        dest.writeString(remindTime);
        dest.writeString(detail);
        if (status == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeString(status);
        }
    }

    public int getId() {
        return (id != null) ? id.intValue() : 0;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPicture() {
        return picture;
    }

    public void setPicture(String picture) {
        this.picture = picture;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getCurrentNumber() {
        return currentNumber;
    }

    public void setCurrentNumber(String currentNumber) {
        this.currentNumber = currentNumber;
    }

    public String getRemindTime() {
        return remindTime;
    }

    public void setRemindTime(String remindTime) {
        this.remindTime = remindTime;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }
}